set $tmp=0
while $tmp<$cpu_number
  eval "tvariable $pc_tcp_%d",$tmp
  eval "tvariable $pc_irq_cctmp_%d",$tmp
  eval "tvariable $pc_irq_cc_%d",$tmp
  eval "tvariable $pc_irq_crtmp_%d",$tmp
  eval "tvariable $pc_irq_cr_%d",$tmp
  eval "tvariable $pc_irq_c_%d",$tmp
  set $tmp=$tmp+1
end

trace tcp_v4_rcv
  commands
    teval $pc_tcp_0=1
  end
list tcp_v4_rcv
trace 1771
  commands
    teval $pc_tcp_0=0
  end

trace irq_enter if ($pc_tcp_0)
  commands
    teval $pc_irq_cctmp_0=$clock
    teval $pc_irq_crtmp_0=$rdtsc
  end
trace irq_exit if ($pc_tcp_0)
  commands
    teval $pc_irq_cc_0=$clock-$pc_irq_cctmp_0+$pc_irq_cc_0
    teval $pc_irq_cr_0=$rdtsc-$pc_irq_crtmp_0+$pc_irq_cr_0
    teval $pc_irq_c_0=$pc_irq_c_0+1
  end

define showall
  set $tmp=0
  while $tmp<$cpu_number
    printf "CPU%d\n",$tmp
    eval "p $pc_irq_c_%d",$tmp
    eval "p $pc_irq_cc_%d/$pc_irq_c_%d",$tmp,$tmp
    eval "p $pc_irq_cr_%d/$pc_irq_c_%d",$tmp,$tmp
    set $tmp=$tmp+1
  end
end
